package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysAttendanceRecord;
import com.ruoyi.system.mapper.SysAttendanceRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysSubjectMapper;
import com.ruoyi.system.domain.SysSubject;
import com.ruoyi.system.service.ISysSubjectService;

/**
 * 学科Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-21
 */
@Service
public class SysSubjectServiceImpl extends ServiceImpl<SysSubjectMapper, SysSubject> implements ISysSubjectService
{
    @Autowired
    private SysSubjectMapper sysSubjectMapper;

    /**
     * 查询学科
     * 
     * @param id 学科主键
     * @return 学科
     */
    @Override
    public SysSubject selectSysSubjectById(Long id)
    {
        return sysSubjectMapper.selectSysSubjectById(id);
    }

    /**
     * 查询学科列表
     * 
     * @param sysSubject 学科
     * @return 学科
     */
    @Override
    public List<SysSubject> selectSysSubjectList(SysSubject sysSubject)
    {
        return sysSubjectMapper.selectSysSubjectList(sysSubject);
    }

    /**
     * 新增学科
     * 
     * @param sysSubject 学科
     * @return 结果
     */
    @Override
    public int insertSysSubject(SysSubject sysSubject)
    {
        sysSubject.setCreateTime(DateUtils.getNowDate());
        return sysSubjectMapper.insertSysSubject(sysSubject);
    }

    /**
     * 修改学科
     * 
     * @param sysSubject 学科
     * @return 结果
     */
    @Override
    public int updateSysSubject(SysSubject sysSubject)
    {
        sysSubject.setUpdateTime(DateUtils.getNowDate());
        return sysSubjectMapper.updateSysSubject(sysSubject);
    }

    /**
     * 批量删除学科
     * 
     * @param ids 需要删除的学科主键
     * @return 结果
     */
    @Override
    public int deleteSysSubjectByIds(Long[] ids)
    {
        return sysSubjectMapper.deleteSysSubjectByIds(ids);
    }

    /**
     * 删除学科信息
     * 
     * @param id 学科主键
     * @return 结果
     */
    @Override
    public int deleteSysSubjectById(Long id)
    {
        return sysSubjectMapper.deleteSysSubjectById(id);
    }
}
